 package com.bmps.springcloud.insuredmicroservice.model.accept.resquest;

 import org.apache.commons.lang3.builder.EqualsBuilder;
 import org.apache.commons.lang3.builder.HashCodeBuilder;

 import javax.validation.Valid;
 import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 import java.io.Serializable;
 import java.util.List;

 /**
  *  @author lyw
  *  @date 2019/07/24
  */
 public class ProductsModel implements Serializable {
     @NotNull(message="prodCount字段不能为空!")
	 private Integer prodCount;

     @Valid
     @NotEmpty(message="product节点不能为空!")
	 private List<ProductModel> product;

     public Integer getProdCount() {
         return prodCount;
     }

     public void setProdCount(Integer prodCount) {
         this.prodCount = prodCount;
     }

     public List<ProductModel> getProduct() {
         return product;
     }

     public void setProduct(List<ProductModel> product) {
         this.product = product;
     }

     @Override
     public boolean equals(Object o) {
         if (this == o) {
             return true;
         }

         if (o == null || getClass() != o.getClass()) {
             return false;
         }

         ProductsModel that = (ProductsModel) o;

         return new EqualsBuilder()
                 .append(prodCount, that.prodCount)
                 .append(product, that.product)
                 .isEquals();
     }

     @Override
     public int hashCode() {
         return new HashCodeBuilder(17, 37)
                 .append(prodCount)
                 .append(product)
                 .toHashCode();
     }

     @Override
     public String toString() {
         return "ProductsModel{" +
                 "prodCount=" + prodCount +
                 ", product=" + product +
                 '}';
     }
 }
